<!--conf
<sample>
              <product version="1.5" edition="pro"/>
                     <modifications>
                            <modified date="070101"/>
                     </modifications>
               </sample>
 --> 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
	<title>Drag-n-drop into tree</title>
</head>

<body onload="onLoad()">
	
	<h1>Drag-n-drop into tree</h1>
	<p>Try to drag any element and drop it on the tree</p>

	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<link rel="stylesheet" type="text/css" href="../../../codebase/dhtmlx.css"/>
	<script src="../../../codebase/dhtmlx.js"></script>
  
   <table>
      <tr>
         <td>
            <div id="treeboxbox_tree" style="width:260px; height:260px;background-color:#f5f5f5;border :1px solid Silver;; "/>
         </td>
         <td>
<div style="padding-left:50px;" onselectstart="return false;">
    <div id="a0">Some text</div> <br/>
    <div id="a1" text="Red" ><div style='width:50px; height:20px; background-color:red;'>&nbsp;</div></div> <br/>
    <div id="a2" text="Green" ><div style='width:50px; height:20px; background-color:green;'>&nbsp;</div></div><br/>
    <div dragInDhtmlXTree="true"  id="a3" text="Blue" ><div style='width:50px; height:20px; background-color:blue;'>&nbsp;</div></div><br/>
    <div dragInDhtmlXTree="true"  id="a4" image="folderOpen.gif" text="Open"><div  style="background-image:url(../../codebase/imgs/dhxtree_skyblue/folderOpen.gif); width:16px; height:16px;font-size:5px;">&nbsp;</div></div><br/>
    <div dragInDhtmlXTree="true"  id="a5" image="folderClosed.gif" text="Closed"><div style="background-image:url(../../codebase/imgs/dhxtree_skyblue/folderClosed.gif); width:18px; height:18px;font-size:5px;">&nbsp;</div></div><br/>
</div>
		 </td>
      </tr>
   </table>

    <br><br>

    <br><br>

   <script>
         tree=new dhtmlXTreeObject("treeboxbox_tree","100%","100%",0);

         tree.setSkin('dhx_skyblue');
    	 tree.setImagePath("../../../codebase/imgs/dhxtree_skyblue/");
	     tree.enableDragAndDrop(true);
         tree.loadXML("../common/tree.xml")
   </script>
<br><br>


    <style>
        div.alfa{
            margin-top:10px;
            margin-left:50px;
        }

    </style>
    <script>

        function onLoad(){

		tree.makeDragable("a0");
		tree.makeDragable("a1");
		tree.makeAllDraggable();

		tree.makeDragable("a2",function(drop_obj,source_id,target_on,target_before){
			drop_obj.insertNewItem(target_on,source_id,"Green 1");
			drop_obj.insertNewItem(target_on,source_id,"Green 2");
			drop_obj.insertNewItem(target_on,source_id,"Green 3");
		});

        }




    </script>


</body>
</html>




